package com.dsbj.mp.icardservice.utils;

import com.dsbj.mp.icardservice.webserviceclient.dsbjpmc.JWSService;
import com.dsbj.mp.icardservice.webserviceclient.dsbjpmc.JWSServiceImplService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@ConfigurationProperties
@Configuration
public class PropertyUtil {
	
	private static String dsbjWsdl;
	
	private static String imageFileRoot;
	
	private static String imageUrlRoot;
	
	private static String oaDocUploaderName;
	private static String oaDocUploaderPassword;
	
	private static Integer oaDocUploadMaincategory;
	private static Integer oaDocUploadSubcategory;
	private static Integer oaDocUploadSeccategory;
	
	private static String workflowId;
	private static String workflowName;
	
	private static String oawsdl;
	
	private static String docwsdl;
	
	private static String hrmwsdl;
	
	private static String appid;
	
	private static String appsecret;
	
	/**
	 * aes秘钥，供请求参数签名使用。
	 */
	private static String aesKey;
	
	@Bean
	public JWSService getJWSServiceImplPort() {
		JWSServiceImplService jwsServiceImpl = new JWSServiceImplService();
		JWSService jwsService = jwsServiceImpl.getJWSServiceImplPort();
		return jwsService;
	}
	
	public static String getDsbjWsdl() {
		return dsbjWsdl;
	}
	
	@Value("${dsbjpmc.wsdl}")
	public void setDsbjWsdl(String dsbjWsdl) {
		PropertyUtil.dsbjWsdl = dsbjWsdl;
	}
	
	public static String getImageFileRoot() {
		return imageFileRoot;
	}
	
	@Value("${image.fileroot}")
	public void setImageFileRoot(String imageFileRoot) {
		PropertyUtil.imageFileRoot = imageFileRoot;
	}
	
	public static String getImageUrlRoot() {
		return imageUrlRoot;
	}
	
	@Value("${image.urlroot}")
	public void setImageUrlRoot(String imageUrlRoot) {
		PropertyUtil.imageUrlRoot = imageUrlRoot;
	}
	
	public static String getOaDocUploaderName() {
		return oaDocUploaderName;
	}
	
	@Value("${ecology.doc.upload-username}")
	public void setOaDocUploaderName(String oaDocUploaderName) {
		PropertyUtil.oaDocUploaderName = oaDocUploaderName;
	}
	
	public static String getOaDocUploaderPassword() {
		return oaDocUploaderPassword;
	}
	
	@Value("${ecology.doc.upload-password}")
	public void setOaDocUploaderPassword(String oaDocUploaderPassword) {
		PropertyUtil.oaDocUploaderPassword = oaDocUploaderPassword;
	}
	
	public static Integer getOaDocUploadMaincategory() {
		return oaDocUploadMaincategory;
	}
	
	@Value("${ecology.doc.main-category}")
	public void setOaDocUploadMaincategory(Integer oaDocUploadMaincategory) {
		PropertyUtil.oaDocUploadMaincategory = oaDocUploadMaincategory;
	}
	
	public static Integer getOaDocUploadSubcategory() {
		return oaDocUploadSubcategory;
	}
	
	@Value("${ecology.doc.sub-category}")
	public void setOaDocUploadSubcategory(Integer oaDocUploadSubcategory) {
		PropertyUtil.oaDocUploadSubcategory = oaDocUploadSubcategory;
	}
	
	public static Integer getOaDocUploadSeccategory() {
		return oaDocUploadSeccategory;
	}
	
	@Value("${ecology.doc.sec-category}")
	public void setOaDocUploadSeccategory(Integer oaDocUploadSeccategory) {
		PropertyUtil.oaDocUploadSeccategory = oaDocUploadSeccategory;
	}
	
	public static String getWorkflowId() {
		return workflowId;
	}
	
	@Value("${ecology.workflow.workflowId}")
	public void setWorkflowId(String workflowId) {
		PropertyUtil.workflowId = workflowId;
	}
	
	public static String getWorkflowName() {
		return workflowName;
	}
	
	@Value("${ecology.workflow.workflowName}")
	public void setWorkflowName(String workflowName) {
		PropertyUtil.workflowName = workflowName;
	}
	
	public static String getOawsdl() {
		return oawsdl;
	}
	
	@Value("${ecology.oawsdl}")
	public void setOawsdl(String oawsdl) {
		PropertyUtil.oawsdl = oawsdl;
	}
	
	public static String getDocwsdl() {
		return docwsdl;
	}
	
	@Value("${ecology.docwsdl}")
	public void setDocwsdl(String docwsdl) {
		PropertyUtil.docwsdl = docwsdl;
	}
	
	public static String getHrmwsdl() {
		return hrmwsdl;
	}
	
	@Value("${ecology.hrmwsdl}")
	public void setHrmwsdl(String hrmwsdl) {
		PropertyUtil.hrmwsdl = hrmwsdl;
	}
	
	public static String getAppid() {
		return appid;
	}
	
	@Value("${wx.appid}")
	public void setAppid(String appid) {
		PropertyUtil.appid = appid;
	}
	
	public static String getAppsecret() {
		return appsecret;
	}
	
	@Value("${wx.appsecret}")
	public void setAppsecret(String appsecret) {
		PropertyUtil.appsecret = appsecret;
	}
	
	public static String getAesKey() {
		return aesKey;
	}
	
	@Value("${aes.aesKey}")
	public void setAesKey(String aesKey) {
		PropertyUtil.aesKey = aesKey;
	}
}
